package com.bus.core.entity;

import com.bus.core.common.Comment;
import com.bus.core.common.CommonSuper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 用户表
 * 1. 注册用户
 * 2. 查询用户信息
 * @author bom
 * @date 2021-12-31
 */
@Entity
@Table(name = "c_user", uniqueConstraints = {
        @UniqueConstraint(columnNames = {"username", "status"}),
        @UniqueConstraint(columnNames = {"phone"}),
        @UniqueConstraint(columnNames = {"email"})
})
@EqualsAndHashCode(callSuper = false)
@Data
@Comment("用户表")
public class UserEntity extends CommonSuper {
    @Id
    @Comment("id")
    private String id;
    /**
     * 昵称
     */
    @Comment("昵称")
    private String nickname;
    /**
     * 用户名
     */
    @Comment("用户名")
    private String username;
    /**
     * 密码
     */
    @Comment("密码")
    private String pwd;
    /**
     * 手机号
     */
    @Comment("手机号")
    private String phone;
    /**
     * 邮箱
     */
    @Comment("邮箱")
    private String email;
}
